package com.github.soiff.shadow.plugin.helper;

import com.github.jknack.handlebars.Helper;
import com.github.jknack.handlebars.Options;

import java.io.IOException;

/**
 * Created by Soiff on 2016/05/20.
 *
 * @author : Soiff
 */
public class InnerStyleHelper implements Helper {
    @Override
    public CharSequence apply(Object context, Options options) throws IOException {
        if(context == null) {
            return "";
        } else {
            StringBuilder ret = new StringBuilder();
            String[] styles = ((String)context).split(";");
            String[] var5 = styles;
            int var6 = styles.length;

            for(int var7 = 0; var7 < var6; ++var7) {
                String style = var5[var7];
                String key = style.split(":")[0];
                if(key.endsWith("radius")) {
                    ret.append(style).append(";");
                }
            }

            return ret;
        }
    }
}
